<?php
  include("include/session.php");
  include("include/db.php");
  include("include/paging.php"); 
  
  if(isset($_REQUEST['del_category']) && intval($_REQUEST['del_category'])){
 	
	mysql_query("UPDATE category SET active = 'N' WHERE category_id = '".intval($_REQUEST['cat_id'])."'");
	header("location:categories.php");
	exit();
  
  }
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/c_energy.css" rel="stylesheet" type="text/css" />
<link href="css/logo.css" rel="stylesheet" type="text/css" />
<script src="hola_script.js" type="text/javascript"></script>
<script src="include/AjaxQuery.js" type="text/javascript"></script>
<title><?=TITLE_WEBSITE?></title>
</head>
<script type="text/javascript" language="javascript">
function approve(){
	document.sitefrm.submit();
}
</script>
<body>

 
  <form name="sitefrm" id="sitefrm" action="" method="post"> 
  	  <input type="hidden" name="action" value="approve" />
<table width="990" align="center" cellpadding="0" cellspacing="0">

    <tr>
        <td colspan="7"  align="left" valign="top" ><? require("header.php");?>       </td>
      </tr>  
	  <tr>
    <td align="center"></td>
  </tr>



        <tr>
        <td width="28%" align="right" valign="top"><a href="rss.php"></a></td>
        <td width="23%" align="left" valign="top"><a href="rss.php"></a></td>
        <td width="22%" align="right" valign="top" style="padding-top:25px">
           <ul class="site_nav_menu_buttons">
			      <li class="no_menu_li"><span>
        			<a href="addcategories.php"><b>Add New Categories</b></a>
                  </span></li>
           </ul> 
                    </td>
        <td width="2%" align="left" valign="top">&nbsp;</td>
        <td width="0%" align="left" valign="top">&nbsp;</td>
        <td width="17%" align="left" valign="top"><a href="channel.php"></a></td>
        <td width="8%" align="center" valign="top">&nbsp;</td>
      </tr>
	  
  <tr>
    <td colspan="8" align="center" valign="top">
		<table width="990" border="0" cellspacing="0" cellpadding="0">

        <tr bgcolor="#FAFAFA">
        <td align="left" valign="top" >
		
		  <table width="74%" cellspacing="0" cellpadding="0">
		    <tr>
		      <td height="161" rowspan="2" align="left" valign="top" style="padding-left:15px; padding-top:26px" >
		          <? require("left.php");?>              </td>
		
				<td height="24" valign="top">&nbsp;</td>
            </tr>
		    <tr>
		      <td valign="top" style="padding-left:15px"><table width="638" cellpadding="0"  cellspacing="0" id="signInTbl" style="border:solid #cccccc 1px;">
                <tr>
                  <td width="494" align="left" bgcolor="#373737" class="loc_search_found_term"  style="border-bottom:solid #cccccc 1px; height:30px; padding-left:10px">Categories</td>
                  <td width="494" align="left" bgcolor="#373737" class="loc_search_found_term"  style="border-bottom:solid #cccccc 1px; height:30px; padding-left:10px">Categories Description</td>
                   <td width="65" align="center" bgcolor="#373737" class="loc_search_found_term"  style="border-bottom:solid #cccccc 1px">Active</td>
                  <td width="65" align="center" bgcolor="#373737" class="loc_search_found_term"  style="border-bottom:solid #cccccc 1px">Edit</td>
                  <td width="76" align="center" bgcolor="#373737" class="loc_search_found_term"  style="border-bottom:solid #cccccc 1px">Delete</td>
                </tr>
                <?php
				  $LanQry   = "SELECT * FROM `prooll_category`";
				  $resQuery = mysql_query($LanQry);
				  while($rowQuery = mysql_fetch_array($resQuery))
				  {	
				?>
               	<input name="webid[]" type="hidden" value="<?=$rowQuery['category_id']?>" />
                <tr <?=preg_match("/1$|3$|5$|7$|9$/",$i++) ? "bgcolor='#E3F8FD'" : "bgcolor='#FFFFFF'"?>>
                  <td style="padding-left:10px" ><?=stripslashes($rowQuery['category_name']);?></td>
                  <td style="padding-left:10px" ><?=stripslashes(substr($rowQuery['category_description'],0,50)).'...';?></td>
                  <td style="padding-left:10px" ><?=($rowQuery['active'] == 'Y' ? 'Active' : 'Non-Active')?></td>
                  <td align="center" ><a href="editcategories.php?category_id=<?=$rowQuery['category_id']?>"><img src="images/edit.png" /></a></td>
                  <td align="center" ><a href="categories.php?cat_id=<?=$rowQuery['category_id']?>&del_category=1"><img src="images/delete.png" /></a></td>
                </tr>
                <?php
				   } 
				?>
                <tr>
                  <td align="center" bgcolor="#373737" class="loc_search_found_term"  style="border-top:solid #cccccc 1px"></td>
                  <td align="center" bgcolor="#373737" class="loc_search_found_term"  style="border-top:solid #cccccc 1px"><a href="javascript:approve()"></a></td>
                  <td align="center" bgcolor="#373737" class="loc_search_found_term"  style="border-top:solid #cccccc 1px"></td>
                  <td width="1" align="center" bgcolor="#373737" class="loc_search_found_term"  style="border-top:solid #cccccc 1px"></td>
                </tr>
              </table></td>
		      </tr>
	        </table>			</td>
        </tr>
      <tr bgcolor="#FAFAFA">
        
        <td colspan="2">&nbsp;</td>
      </tr>
    </table>	</td>
  </tr>
</table>
  </form>
</body>
</html>

